import { createI18n } from 'vue-i18n';
import Store from '@/store';
import elementEnLocale from 'element-plus/es/locale/lang/en';
import elementZhLocale from 'element-plus/es/locale/lang/zh-cn';
import enLocale from './en';
import zhLocale from './zh';
import AvueEnLocale from '@smallwei/avue/lib/locale/lang/en';
import AvueZhLocale from '@smallwei/avue/lib/locale/lang/zh';

import zh_CN from './zh_CN'
import en_US from './en_US'


export const messages = {
  // en: {
  //   ...enLocale,
  //   ...AvueEnLocale,
  //   ...elementEnLocale,
  // },
  // 'zh-cn': {
  //   ...zhLocale,
  //   ...AvueZhLocale,
  //   ...elementZhLocale,
  // },
  zh_CN: {
    ...zhLocale,
    ...AvueZhLocale,
    ...elementZhLocale,
    ...zh_CN
  },
  en_US: {
    ...enLocale,
    ...AvueEnLocale,
    ...elementEnLocale,
    ...en_US
  }
};
export const language = Store.getters.language;
export default createI18n({
  legacy: false,
  locale: language,
  messages,
});
